<?php 
use Common\Model\Cate;
$cateModel=new Cate;
//显示头部导航
$cateData=$cateModel->where("pid=0")->orderBy('sort','DESC')->limit(6)->get();
//显示侧导航
$nav=$cateModel->where("pid=0")->orderBy('sort','DESC')->limit(8)->get();
foreach($nav as $k=>$v){
$cid=$nav[$k]['cid'];
	$nav[$k]['value']=$cateModel->where("pid={$cid}")->limit(4)->get();
}
//显示网站导航
$navData=$cateModel->where("pid=0")->orderBy('sort','DESC')->limit(8)->get();
 ?>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="./Public/home/css/index.css"/>
		<link rel="stylesheet" type="text/css" href="./Public/home/css/list.css"/>
		<link rel="stylesheet" type="text/css" href="./Public/home/css/header.css"/>
		<link rel="stylesheet" type="text/css" href="./Public/home/css/content.css"/>
		<script src="./Public/home/js/jquery-1.7.2.min.js"></script>
		<script src="./Public/home/js/style.js"></script>
		<script src="./Public/home/js/area.js"></script>
		<!--上传插件-->
		 <script src="./Public/uploadify/jquery-1.8.2.min.js" type="text/javascript" charset="utf-8"></script>
	    <script src="./Public/uploadify/jquery.uploadify.min.js" type="text/javascript" charset="utf-8"></script>
	    <link rel="stylesheet" type="text/css" href="./Public/uploadify/uploadify.css"/>
	</head>
	<body>
	<div id="edit-password"></div>
	<div class="edit-box">
		<div class="edit-box-title">修改密码<span class="del">x</span></div>
		<div class="edit-box-content">
			<form action="<?php echo U('Member/edit')?>" method="post">
				<span>旧 密 码：</span><input type="password" name="oldpassword" placeholder="请输入旧密码" /><br />
				<span> 密 码：</span><input type="password" name="password" placeholder="请输入新密码" /><br />
				<span>确认密码：</span><input type="password" name="repassword" placeholder="请确认新密码"/><br />	
				<span>验证码：</span><input type="text" name="code" placeholder="请输入验证码" style="width: 160px;"/><img src="<?php echo U('Member/code')?>" style="position: relative;top:10px;margin-left: 5px;"/>
				<input type="hidden" name="uid" value="<?php echo $_SESSION['nickuser']['uid']?>" />
				<input type="submit" value="提交" class="edit-box-btn"/>
			</form>
		</div>
	</div>
	<!--header-->
	<div id="header">
		<div class="header"> 
			<div class="headerTop">
				<div class="headerLeft">
					<h1>
						<a href="<?php echo U('Index/index')?>"><img src="./Public/home/images/logo1_cc09ff8.png"/></a>
					</h1>
				</div>
				<div class="headerRight">
					<ul class="header-car">
						<li class="shop-car">
							<a href="<?php echo U('Cart/index')?>" class="cart-add">购物车(<span><?php if(isset($_SESSION['cart'])){?>
                <?php echo $_SESSION['cart']['total_rows']?><?php }else{?>0
               <?php }?></span>)</a>
						</li>
					</ul>
					<!--搜索-->
					<div class="select">
						<form action="<?php echo U('List/index')?>" method="post">
							<input type="text" name="select" class="select-box" />
							<input type="submit" value="So索" class="select-btn"/>
						</form>
					</div>
					<ul class="navbar">
						<li><a href="<?php echo U('Index/index')?>" >首页</a></li>
						<?php foreach ($cateData as $c){?>
						<li><a href="<?php echo U('List/index',['cid'=>$c['cid']])?>"><?php echo $c['cname']?></a></li>
						<?php }?>
					</ul>
				</div>
			</div>
			<div class="header-bottom">
				<div class="header-bottom-box">
					<div class="bottom-left-hover">
						<div class="header-bottom-left">全部商品分类</div>
						<ul class="nav-list">
						<?php foreach ($nav as $n){?>
							<li>
								<a href="<?php echo U('List/index',['cid'=>$n['cid']])?>" class="nav-list-title"><?php echo $n['cname']?></a>
								<?php foreach ($n['value'] as $v){?>
								<a href="<?php echo U('List/index',['cid'=>$v['cid']])?>"><?php echo $v['cname']?></a>
								<?php }?>
							</li>
						<?php }?>
					</ul>
					</div>
					<ul class="header-bottom-right">
						<li class="li-nav">
							<span style="padiving-left: 15px;">网站导航</span>
							<div class="all-list">
								<?php foreach ($navData as $v){?>
								<div><a href="<?php echo U('List/index',['cid'=>$v['cid']])?>"><?php echo $v['cname']?></a></div>
								<?php }?>
							</div>
						</li>
						<?php if(isset($_SESSION['nickuser'])){?>
                
						<li>
							<a href="<?php echo U('Presonal/index')?>"><?php echo $_SESSION['nickuser']['nickname']?></a>
							<a href="<?php echo U('Member/del')?>">退出登录</a>
							
						</li>
						<?php }else{?>
						<li>
							<a href="<?php echo U('Member/index')?>">登录</a>
							<a href="<?php echo U('Member/reg')?>">注册</a>
							<!--<a href="">忘记密码？</a>-->
						</li>
						
               <?php }?>
						<li class="order"><a href="<?php echo U('Presonal/order')?>">我的订单</a></li>
					</ul>
				</div>
			</div>
		</div>
	</div>
	<!--/header-->